<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<!--
			随机10个数55-80，按照大小排序，冒泡排序
		-->
		<script type="text/javascript">
			var arr = [50, 54, 63, 72, 81, 91, 99, 82, 90, 88];
			for(var i = 0; i < arr.length; i++) {
				for(var j = 0; j < arr.length - i; j++) {
					if(arr[j] > arr[j + 1]) {
						temp = arr[j + 1];
						arr[j + 1] = arr[j];
						arr[j] = temp;
					}
				}
			}
			document.write(arr);

			document.write("<hr/>");
			//简单方法，冒泡排序
			var arr = [50, 54, 63, 72, 81, 91, 99, 82, 90, 88];
			arr.sort(function(a, b) {
				return a - b;
			})
			document.write(arr);
		</script>
	</body>

</html>